Skip to content

Conversation

@pbalcer
Copy link
Contributor

@pbalcer pbalcer commented Feb 24, 2025

Description

Implement malloc_usable_size and enable pool tests for disjoint.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • New tests added, especially if they will fail without my changes

@pbalcer pbalcer requested a review from a team as a code owner February 24, 2025 14:14
slab_t *slab =
(slab_t *)critnib_find_le(disjoint_pool->known_slabs, (uintptr_t)ptr);
if (slab == NULL || ptr >= slab_get_end(slab)) {
// regular free
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think comment is incorrect because of copy-n-paste

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@pbalcer pbalcer force-pushed the malloc-usable-size-disjoint-pool branch from 943545a to 585547e Compare February 24, 2025 14:23
@pbalcer pbalcer force-pushed the malloc-usable-size-disjoint-pool branch 2 times, most recently from 71d089d to 7d5a238 Compare February 24, 2025 14:30
Copy link
Contributor

@lplewa lplewa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests with allocations done with umfPoolAlignedMalloc().

In almost sure that in the case when we used some "usable" memory to align ptr, you must substract it from "bucket size".

@pbalcer pbalcer force-pushed the malloc-usable-size-disjoint-pool branch from 7d5a238 to cbdd3ac Compare February 24, 2025 14:43
@pbalcer
Copy link
Contributor Author

pbalcer commented Feb 24, 2025

Please add tests with allocations done with umfPoolAlignedMalloc().

In almost sure that in the case when we used some "usable" memory to align ptr, you must substract it from "bucket size".

done.

@pbalcer pbalcer force-pushed the malloc-usable-size-disjoint-pool branch 10 times, most recently from 7cc6fdc to c2f9d5d Compare February 25, 2025 13:12
@pbalcer pbalcer force-pushed the malloc-usable-size-disjoint-pool branch 2 times, most recently from f90922b to 249c364 Compare February 25, 2025 14:24
@bratpiorka bratpiorka merged commit 5d67494 into oneapi-src:main Feb 26, 2025
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants